import pdfplumber
# 打开PDF文件
with pdfplumber.open('test.pdf') as pdf:
         for i in pdf.pages:
             print(i.extract_text())    #提取内容
             print(f'----------第{i.page_number}页结束----------')